package dry.example.study;

import java.util.StringTokenizer;

/**
 * @author zc
 */
public class Demo {

    /**
     * 3
     * /a
     * /a/b
     * /a/b/c
     */
    private static void run01() {
        String pathFull = "/a/b/c";
        StringTokenizer st = new StringTokenizer(pathFull, "/");
        System.out.println(st.countTokens());
        String pathCurrent = "";
        while (st.hasMoreElements()) {
            pathCurrent = String.format("%s/%s", pathCurrent, st.nextElement());
            System.out.println(pathCurrent);
        }
    }

    public static void main(String[] args) {
        run01();
    }

}